package demo02;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import com.typesafe.config.ConfigFactory;
import demo02.actor.AgentActor;
import demo02.actor.AgentMerger;
import demo02.actor.MasterActor;
/**
 * Created by 抽离 on 2017/6/20 0020.
 */
public class Main {
    public static void main(String[] args){
        ActorSystem masterSystem = ActorSystem.create("masterSystem", ConfigFactory.load().getConfig("ActorSystem"));
        ActorSystem agentSystem = ActorSystem.create("agentSystem", ConfigFactory.load().getConfig("ActorSystem"));
        ActorSystem agentMergeSystem = ActorSystem.create("agentMergeSystem", ConfigFactory.load().getConfig("ActorSystem"));
        ActorRef agentMergerRef = agentMergeSystem.actorOf(Props.create(AgentMerger.class), "defaultDispatcher");
        ActorRef agentRef = agentSystem.actorOf(Props.create(AgentActor.class, agentMergerRef), "defaultDispatcher");
        ActorRef masterRef = masterSystem.actorOf(Props.create(MasterActor.class, agentRef), "commonDispatcher");
//        actorRef.tell("url", ActorRef.noSender());
    }
}
